package com.yhgm.utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.stereotype.Component;

@Component
public class ESClient {
    private final RestHighLevelClient client=new RestHighLevelClient(
            RestClient.builder(
                    HttpHost.create("http://localhost:9200")
            )
    );

    public RestHighLevelClient getClient() {
        return client;
    }
}
